﻿<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<title><{config_item('manager_title')}></title>
	<link href="/public/H-ui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
	<link href="/public/H-ui/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
	<link href="/public/H-ui/hui-iconfont/iconfont.css" rel="stylesheet" type="text/css">
</head>
<body>
<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 权限管理 <span class="c-gray en">&gt;</span> 管理员列表 <a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="pd-20" style="padding-top: 0px;">
	<div class="text-c pt-20">
		<form action="<{site_url('/manager/system/admin/')}>" method="post" class="form form-horizontal" id="search" name="search">
			<span class="select-box" style="width:150px">
				<select name="role_id" class="select">
					<option value="">角色分组</option>
					<{foreach $role_list as $k}>
					<option value="<{$k.id}>"><{$k.name}></option>
					<{/foreach}>
				</select>
			</span>
			<input type="text" name="username" placeholder="用户名" style="width:150px" class="input-text">
			<span class="select-box" style="width:150px">
				<select name="status" class="select">
					<option value="">选择状态</option>
					<{foreach $status as $v=>$k}>
					<option value="<{$v}>"><{$k}></option>
					<{/foreach}>
				</select>
			</span>
			<button class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
		</form>
	</div>
	<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l">
		<a href="javascript:;" class="btn btn-primary radius" onclick="open_iframe('添加管理员','<{site_url('/manager/system/admin/edit')}>','100%')"><i class="Hui-iconfont">&#xe600;</i> 添加管理员</a>
		<a href="javascript:;" onclick="data_del(this,'<{site_url('/manager/system/admin/update_status/')}>?status=0')" class="btn btn-primary radius">审核</a>
		<a href="javascript:;" onclick="data_del(this,'<{site_url('/manager/system/admin/update_status/')}>?status=1')" class="btn btn-primary radius">锁定</a>
	</span></div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort">
			<thead>
			<tr class="text-c">
				<th width="40"><input name="" type="checkbox" value=""></th>
				<th width="50">ID</th>
				<th>登录账户</th>
				<th width="80">真实姓名</th>
				<th width="80">角色</th>
				<th width="100">电话</th>
				<th width="80">注册时间</th>
				<th width="80">最后登录时间</th>
				<th width="100">状态</th>
				<th width="80">操作</th>
			</tr>
			</thead>
			<tbody>
			<{foreach $list as $key}>
			<tr class="text-c">
				<td><input name="id[]" type="checkbox" value="<{$key.id}>"></td>
				<td><{$key.id}></td>
				<td class="text-l"><{$key.username}></td>
				<td class="text-l"><{$key.full_name}></td>
				<td><{$role_list[$key.role_id]['name']}></td>
				<td class="text-l"><{$key.tel}></td>
				<td><{date('Y-m-d',$key.addtime)}></td>
				<td><{date('Y-m-d',$key.lasttime)}></td>
				<td>
					<span class="select-box">
						<select name="status" class="select" onchange="update_status('<{$key.id}>',this.value);">
							<{foreach $status as $v=>$k}>
							<option value="<{$v}>" <{if $key.status==$v}>selected<{/if}>><{$k}></option>
							<{/foreach}>
						</select>
					</span>
				</td>
				<td class="f-14 td-manage">
					<a style="text-decoration:none" class="ml-5" onClick="open_iframe('编辑','<{site_url("/manager/system/admin/edit/<{$key.id}>")}>','100%')" href="javascript:;" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a>
					<a style="text-decoration:none" class="ml-5" onClick="data_del(this,'<{site_url('/manager/system/admin/delete/')}>','<{$key.id}>')" href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a>
				</td>
			</tr>
			<{/foreach}>
			</tbody>
		</table>
	</div>
</div>
<!--分页-->
<{page_view('page',$page_count,search_array_to_link($search_where))}>
<script type="text/javascript" src="/public/js/jquery.js"></script>
<script type="text/javascript" src="/public/js/layer/layer.js"></script>
<script type="text/javascript" src="/public/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/public/js/form.js"></script>
<script type="text/javascript" src="/public/H-ui/js/H-ui.js"></script>
<script type="text/javascript" src="/public/H-ui/js/H-ui.admin.js"></script>
<script language="JavaScript">
	$(function(){
		//表单回填
		var formObj = new Form();
		formObj.init(<{ch_json_encode($search_where)}>);
	})

	/*更新信息状态
	 * @ids会员id 对象
	 * @status 状态
	 * */
	function update_status(ids,status){
		if(ids==''){
			layer.msg('没有选择任何数据!');
			return false;
		}
		$.ajax({
			type:"POST",
			url: "<{site_url('/manager/system/admin/update_status')}>",
			data:"id="+ids+"&status="+status,
			dataType:"json",
			success: function(data){
				if(data.status!='y'){
					layer.msg(data.info);
				}
			}
		});
	}
</script>
</body>
</html>